<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sapfree.core.db.RecordSet"%>
<%@ page import="net.sapfree.core.db.Record"%>
<%
String path = request.getContextPath();
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="login,regist second">
<meta http-equiv="description" content="This is professionalmodule regist page">
<title>我的飞客-注册-技术专长</title>
<link href="<%=path%>/include/styleBase/css/ostable.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/leftPage.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/styleBase.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/messageType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/exchangeType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/userType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/headfoot.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/fontStyle.css" rel="stylesheet"></link>


<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 20px;
	margin-right: 0px;
	margin-bottom: 0px;
}

body,div { 
font-family:verdana; 
line-height:100%; 
font-size:10pt; 
} 
input { 
width:320px; 
} 
h1 { 
text-align:center; 
font-size:2.2em; 
} 
#moduleselect { 
border:1px solid #000; 
}
.des { 
width:500px; 
background-color:lightyellow; 
border:1px solid #555; 
padding:25px; 
margin-top:25px; 
} 
.mouseover { 
color:#ffffff; 
background-color:highlight; 
width:100%; 
cursor:default; 
} 
.mouseout { 
color:#000; 
width:100%; 
background-color:#ffffff; 
cursor:default; 
} 
-->
</style>

<%
String personuuid = (request.getAttribute("personuuid")==null)?"":request.getAttribute("personuuid").toString();
String modulenames = (request.getAttribute("modulenames")==null)?"":request.getAttribute("modulenames").toString();
RecordSet moduleset = (request.getAttribute("moduleset")==null)?null:(RecordSet)request.getAttribute("moduleset");
Record personinfo = (request.getAttribute("personinfo")==null)?null:(Record)request.getAttribute("personinfo");

int projectmanager = 0;
int teamleader = 0;
int consultant = 0;
if(personinfo!=null){
	projectmanager = personinfo.getInt("PI_PROJECTMANAGER");
	teamleader = personinfo.getInt("PI_TEAMLEADER");
	consultant = personinfo.getInt("PI_CONSULTANT");
}
%>
</head>
<body>
<form name="frm" method="post">
<input type="hidden" name="personuuid" value="<%=personuuid%>">
<input type="hidden" name="nextaction" value="project">
<table border="0" cellspacing="20" cellpadding="0" bgcolor="#CCCCCC" width="800" align="center">
<tr>
		<td width="958" height="200" bgcolor="#FFFFFF" valign="top">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
        	<tr>
            	<td width="50%" align="center">
		        <img src="<%=path%>/images/logo.jpg" border="0">                </td>
                <td width="50%">
              	</td>
          	</tr>
            <tr>
            	<td colspan="2"><table border="0" cellpadding="0" cellspacing="0" width="98%" align="center"><tr id="module1" style="display:block"><td height="40" align="left"><table border="0" cellpadding="0" cellspacing="0" width="98%" align="center">
                  <tr>
                    <td colspan="6" height="20"></td>
                  </tr>
                  <tr>
                    <td align="CENTER" height="40" colspan="8"><table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
                        <tr>
                          <td class="tip">请输入您的技能，网站将根据您的输入，为您寻找相关模块的群和属于该群的好友并为您生成简历：&nbsp;&nbsp;</td>
                        </tr>
                    </table></td>
                  </tr>
                  
                  <tr>
                  	<td colspan="6">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="professionalmodule">
                      <tr id="moduletitle" style="display:block">
                        <td width="9%" align="right">&nbsp;</td>
                        <td width="27%" height="40" align="right">&nbsp;</td>
                        <td width="19%" height="40" align="center" class="blackNormal14">自由顾问年限</td>
                        <td width="19%" align="center" class="blackNormal14">外部顾问年限</td>
                        <td width="18%" align="center" class="blackNormal14">内部顾问年限</td>
                        <td width="8%">&nbsp;</td>
                      </tr>
                      <%
					  int hasmodulecount = 0;
					  if(moduleset!=null){
					  	hasmodulecount = moduleset.size();
					  	for(int m=0;m<moduleset.size();m++){
							Record modulerecord = (Record)moduleset.get(m);
							String module = modulerecord.getString("PPM_MODULENAME");
							String freeyear = modulerecord.getString("PPM_FREE");
							String waibuyear = modulerecord.getString("PPM_WAIBU");
							String neibuyear = modulerecord.getString("PPM_NEIBU");
					  %>
                      <tr>
                      	<td width="9%" align="right" height="40">&nbsp;</td>
                        <td width="27%" height="40" align="right">
                        <input type="hidden" name="module" value="<%=m%>">
                        <input type="text" name="MODULE<%=m%>_PPM_MODULENAME" class="textInput" style="width:150px;" onKeyUp="jsModuleInstance.handleEvent(this.value,'MODULE<%=m%>_PPM_MODULENAME',event)" id="MODULE<%=m%>_PPM_MODULENAME" value="<%=module%>">
                        </td>
                        <td width="19%" height="40" align="center" class="blackNormal14"><input name='MODULE<%=m%>_PPM_FREE' id='MODULE<%=m%>_PPM_FREE' type='text' class='textInput' style='width:50px;' value="<%=freeyear%>"  onFocus="this.select()">年</td>
                        <td width="19%" align="center" class="blackNormal14"><input name='MODULE<%=m%>_PPM_WAIBU' id='MODULE<%=m%>_PPM_WAIBU' type='text' class='textInput' style='width:50px;' value="<%=waibuyear%>"  onFocus="this.select()">年</td>
                        <td width="18%" align="center" class="blackNormal14"><input name='MODULE<%=m%>_PPM_NEIBU' id='MODULE<%=m%>_PPM_NEIBU' type='text' class='textInput' style='width:50px;' value="<%=neibuyear%>"  onFocus="this.select()">年</td>
                        <td width="8%">&nbsp;</td>
                      </tr>
                      <%
						}
					  }
					  //如果已注册三个以上的业务模块，则不显示空业务模块，手工添加
					  if(hasmodulecount<3){
					  	for(int j=hasmodulecount;j<3;j++){
					  %>
						<tr>
							<td width="9%" align="right" height="40">&nbsp;</td>
							<td width="27%" height="40" align="right">
                            <input type="hidden" name="module" value="<%=j%>">
                            <input type="text" name="MODULE<%=j%>_PPM_MODULENAME" class="textInput" style="width:150px;"    onKeyUp="jsModuleInstance.handleEvent(this.value,'MODULE<%=j%>_PPM_MODULENAME',event)" id="MODULE<%=j%>_PPM_MODULENAME"></td>
							<td width="19%" height="40" align="center" class="blackNormal14"><input name='MODULE<%=j%>_PPM_FREE' id='MODULE<%=j%>_PPM_FREE' type='text' class='textInput' style='width:50px;'  onFocus="this.select()">年</td>
							<td width="19%" align="center" class="blackNormal14"><input name='MODULE<%=j%>_PPM_WAIBU' id='MODULE<%=j%>_PPM_WAIBU' type='text' class='textInput' style='width:50px;'  onFocus="this.select()">年</td>
							<td width="18%" align="center" class="blackNormal14"><input name='MODULE<%=j%>_PPM_NEIBU' id='MODULE<%=j%>_PPM_NEIBU' type='text' class='textInput' style='width:50px;'  onFocus="this.select()">年</td>
							<td width="8%">&nbsp;</td>
                      	</tr>
                      <%
					  	}
					  }
					  %>
                      
    				</table>
                  </td>
                  </tr>
    
                  <tr>
                    <td height="20" colspan="6" align="right"></td>
                  </tr>
                  <tr>
                    <td align="CENTER" height="40" colspan="8"><table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
                        <tr>
                          <td class="tip">请填写您在多少个项目中担当不同的角色，没有请不填，它将不会出现在您的简历中：&nbsp;&nbsp;
                              <!--<span class="orangeNormal14" style="cursor:hand;" onClick="_showArea();">+点击选择行业</span>--></td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr>
                  	<td colspan="6">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                      <tr id="areatitle" style="display:block">
                        <td width="15%" align="right">&nbsp;</td>
                        <td height="80%" colspan="2" align="left" class="blackNormal14">在
                          <input type="text" class="textInput" style="width:50px;" name="PERSON_PI_PROJECTMANAGER" value="<%=projectmanager%>"  onFocus="this.select()">
                          个项目中担任<strong>项目经理</strong></td>
                        <td height="80%" align="left" class="blackNormal14">在
                          <input type="text" class="textInput" style="width:50px;" name="PERSON_PI_TEAMLEADER" value="<%=teamleader%>"  onFocus="this.select()">
个项目中担任<strong>TeamLeader</strong></td>
                      </tr>
                      <tr id="areatitle" style="display:block">
                        <td width="15%" align="right">&nbsp;</td>
                        <td height="40" colspan="2" align="left" class="blackNormal14">在
                          <input type="text" class="textInput" style="width:50px;" name="PERSON_PI_SUPERCONSULTANT" value="<%=consultant%>"  onFocus="this.select()">
个项目担任<strong>高级顾问</strong></td>
                        <td width="45%" colspan="3" align="left" class="blackNormal14">在
                          <input type="text" class="textInput" style="width:50px;" name="PERSON_PI_CONSULTANT" value="<%=consultant%>"  onFocus="this.select()">
个项目担任<strong>顾问</strong></td>
                      </tr>
                      
                      
                      <tr>
                        <td align="right">&nbsp;</td>
                        <td width="24%" height="40" align="right">&nbsp;</td>
                        <td height="40" colspan="4">&nbsp;</td>
                      </tr>
                      </table>
                  </td>
                  </tr>
                  <tr>
                    <td height="40" colspan="6" align="center"><table border="0" cellpadding="0" cellspacing="0" width="257">
                        <tr>
                          <td width="128" align="center"><table border="0" cellpadding="0" cellspacing="0" width="87%">
                              <tr>
                                <td width="101" height="30" bgcolor="f6891f" align="center" style="cursor:hand;"><a href="#" onClick="_preview()"><span style="color:#FFFFFF; font-weight:bold; font-size:14px;">＜＜上一页</span></a></td>
                              </tr>
                          </table></td>
                          <td width="41">&nbsp;</td>
                          <td width="112" height="30" bgcolor="f6891f" align="center" style="cursor:hand;"><a href="#" onClick="_next()"><span style="color:#FFFFFF; font-weight:bold; font-size:14px;">下一页 ＞＞</span></a></td>
                        </tr>
                    </table></td>
                    <td width="1%" height="40" align="center"></td>
                  </tr>
                  <tr>
                    <td height="30" colspan="6" class="orangeNormal14" align="right"><a href="resumeview1.html">+简历预览</a>&nbsp;&nbsp;</td>
                  </tr>
                  <tr>
                    <td></td>
                    <td height="20"></td>
                  </tr>
                </table></td>
                    </tr>
            	</table>
              </td>
            </tr>
        </table>
        </td> 
  </tr>
   
</table>
<br>
<br>
<br>
<div id="moduleselect"></div>
</form>
</body>

</html>

<script type="text/javascript" src="../include/js/autoselect.js"></script>

<script language="javascript">
var jsModuleInstance = new jsAuto("jsModuleInstance","moduleselect");
jsModuleInstance.item("<%=modulenames%>");
</script>

<script>
var tempRow=0;
var maxRows=0;
function insertRows(module){
	var inserttable = document.getElementById("professionalmodule");
	 tempRow=inserttable.rows.length-1;
	 maxRows=tempRow;
	 tempRow=tempRow+1;
	 var Rows=inserttable.rows;//类似数组的Rows
	 
	 var newRow=inserttable.insertRow(inserttable.rows.length);//插入新的一行
	 var Cells=newRow.cells;//类似数组的Cells
	 for (i=0;i<6;i++)//每行的6列数据
	 {
		  var newCell=Rows(newRow.rowIndex).insertCell(Cells.length);
		  newCell.align="center";
		  newCell.height="40px";
		   switch (i)
		   {
		   		case 0: newCell.innerHTML="<td align=\"center\" class=\"blueBold14\" height='40'>&nbsp;</td>";break;
				case 1: newCell.innerHTML="<td align='center' height='40px' class='blueBold14'>"+module+"                    <input type='hidden' name='module' value='"+module+"'></td>";break;
				case 2: newCell.innerHTML="<td height='40' align='center'><input name='MODULE"+module+"_PPM_FREE' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 3: newCell.innerHTML="<td height='40' align='center'><input name='MODULE"+module+"_PPM_WAIBU' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 4: newCell.innerHTML="<td height='40' align='center'><input name='MODULE"+module+"_PPM_NEIBU' type='text' class='textInput' style='width:50px;'>年</td>";break;
				case 5: newCell.innerHTML="<td align=\"center\" class=\"blueBold14\">&nbsp;</td>";break;
		   }
	 }
	 maxRows+=1;
}
function delTableRow(rowNum){
if (table1.rows.length >rowNum){
table1.deleteRow(rowNum);
}
}

function _next(){
	frm.action="<%=request.getContextPath()%>/regist/registservlet?method=registModule";
	frm.submit();
}

function _preview(){
	frm.action="<%=request.getContextPath()%>/regist/registservlet";
	frm.submit();
}

	function goPage(url){
		window.parent.$("#mainFrame").attr("src",url);
	}
	function _showModule(){
		document.getElementById("modulesel").style.display="block";
	}
	function _closeModule(){
		document.getElementById("modulesel").style.display="none";
	}
	function _showModuleLine(i){
		document.getElementById("moduletitle").style.display="block";
		document.getElementById("module"+i).style.display="block";
	}
	
	function _hideModule(i){
		document.getElementById("module"+i).style.display="none";
	}
	
	function _showArea(){
		document.getElementById("areasel").style.display="block";
	}
	function _closeArea(){
		document.getElementById("areasel").style.display="none";
	}
	function _showAreaLine(i){
		document.getElementById("areatitle").style.display="block";
		document.getElementById("area"+i).style.display="block";
	}
	
	function _hideArea(i){
		document.getElementById("area"+i).style.display="none";
	}
</script>
